//============================================================================
// Name        : ENPostProcessing.cpp
// Author      : 
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#include <iostream>
#include "ResidueCM.h"
#include "ResidueAvg.h"
#include "ForceConst.h"
using std::ofstream;
using std::ifstream;
using std::ios_base;

using namespace std;

int main(int argc, char *argv[]) {
	float Percent=100.0;
	stringstream readit;
	int n=1;
	for(;;){
		if(n>=argc) break;
		string opt;
		opt.assign(argv[n]);
		if(opt[0] == '-') {
			switch(opt[1]){
			case 'h':
				cout<< "Usage: " << argv[0] << " -p percentage " << endl;
				exit(1);
			case 'p':
				readit << argv[++n];
				readit >> Percent;
				break;
			default:
				cout << "option not found abort " << endl;
				exit(1);
			}
		}
		n++;
	}

	ForceConst MyKs;
	MyKs.SetP(Percent);
	ifstream fin;
    const char * cstr = "RmsDist.dat";
	fin.open(cstr,ifstream::out|ifstream::binary);
	fin >> MyKs;
	MyKs.Svd();

	return 0;
}
